# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kitinerary
pkgver=20.04.3
pkgrel=1
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
url="https://kontact.kde.org/"
pkgdesc="Data model and extraction system for travel reservation information"
license="LGPL-2.0-or-later"
depends_dev="
	kmime-dev
	kcalendarcore-dev
	kcontacts-dev
	kpkpass-dev
	"
makedepends="
	$depends_dev
	extra-cmake-modules
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	ki18n-dev
	poppler-dev
	zlib-dev
	libxml2-dev
	shared-mime-info
	"
source="https://download.kde.org/stable/release-service/$pkgver/src/kitinerary-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build

	# jsonlddocumenttest, mergeutiltest, airportdbtest, pkpassextractortest,
	# postprocessortest, calendarhandlertest and extractortest are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest \
		-E "(jsonlddocument|mergeutil|airportdb|pkpassextractor|postprocessor|calendarhandler|extractor)test"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="eee734fc06373aed09e0eadd7ef232cde5ba07adf4d0996117bc4a0ee16cf80fc7f607ae1dc92033ea404e70eb8afcf5a676ff71e286613272c0d1051d7b7168  kitinerary-20.04.3.tar.xz"
